struct ListNode* removeElements(struct ListNode* head, int val) {
	if (!head)
		return head;
	struct ListNode* cur = NULL;
	struct ListNode* delNode = NULL;
	//头节点
	while (head && (head->val == val))
	{
		delNode = head;
		head = delNode->next;
		free(delNode);
		delNode = NULL;
	}
	//非头节点
	cur = head;
	while (cur && (cur->next))
	{
		if ((cur->next->val) == val) {
			delNode = cur->next;
			cur->next = delNode->next;
			free(delNode);
			delNode = NULL;
		}
		else
			cur = cur->next;
	}
	return head;
}